<h1>Listing invoices</h1>

<table class="table table-bordered">
  <tr>
  	<th>Invoice Date</th>
    <th>Customer</th>
    <th>User</th>
    <th>Status</th>
    <th></th>
    <th></th>
  </tr>

<% @invoices.each do |invoice| %>
  <tr>
  	<td><%= invoice.created_at.strftime("%Y-%m-%d") %></td>
    <td><%= invoice.customer_id %></td>
    <td><%= invoice.user_id %></td>
    <td><%= invoice.status %></td>
    <td><%= link_to 'Show', invoice %>
    	<%= link_to 'Edit', edit_invoice_path(invoice) %>
    <%= link_to 'Destroy', invoice, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Invoice', new_invoice_path, :class => "btn btn-default"  %>
